home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / ImageCodec.p < prev    next >
Text File  |  1996-05-01  |  10KB  |  273 lines

  1. {
  2.      File:        ImageCodec.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.1
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ImageCodec;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __IMAGECODEC__}
  28. {$SETC __IMAGECODEC__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ImageCodecIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QDOFFSCREEN__}
  41. {$I QDOffscreen.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __WINDOWS__}
  44. {$I Windows.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  47. {$I ImageCompression.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __COMPONENTS__}
  50. {$I Components.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __MOVIES__}
  53. {$I Movies.p}
  54. {$ENDC}
  55.  
  56. {$PUSH}
  57. {$ALIGN MAC68K}
  58. {$LibExport+}
  59.  
  60. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  61. {     codec component selectors     }
  62.  
  63. CONST
  64.     codecGetCodecInfo            = $00;
  65.     codecGetCompressionTime        = $01;
  66.     codecGetMaxCompressionSize    = $02;
  67.     codecPreCompress            = $03;
  68.     codecBandCompress            = $04;
  69.     codecPreDecompress            = $05;
  70.     codecBandDecompress            = $06;
  71.     codecCDSequenceBusy            = $07;
  72.     codecGetCompressedImageSize    = $08;
  73.     codecGetSimilarity            = $09;
  74.     codecTrimImage                = $0A;
  75.     codecRequestSettings        = $0B;
  76.     codecGetSettings            = $0C;
  77.     codecSetSettings            = $0D;
  78.     codecCDSequenceFlush        = $0E;
  79.     codecSetTimeCode            = $0F;
  80.     codecIsImageDescriptionEquivalent = $10;
  81.     codecNewMemory                = $11;
  82.     codecDisposeMemory            = $12;
  83.     codecHitTestData            = $13;
  84.  
  85. {     codec selectors 0-127 are reserved by Apple  }
  86. {     codec selectors 128-191 are subtype specific  }
  87. {     codec selectors 192-255 are vendor specific  }
  88. {     codec selectors 256-32767 are available for general use  }
  89. {     negative selectors are reserved by the Component Manager  }
  90. {     codec capabilities flags     }
  91.     codecCanScale                = $00000001;
  92.     codecCanMask                = $00000002;
  93.     codecCanMatte                = $00000004;
  94.     codecCanTransform            = $00000008;
  95.     codecCanTransferMode        = $00000010;
  96.     codecCanCopyPrev            = $00000020;
  97.     codecCanSpool                = $00000040;
  98.     codecCanClipVertical        = $00000080;
  99.     codecCanClipRectangular        = $00000100;
  100.     codecCanRemapColor            = $00000200;
  101.     codecCanFastDither            = $00000400;
  102.     codecCanSrcExtract            = $00000800;
  103.     codecCanCopyPrevComp        = $00001000;
  104.     codecCanAsync                = $00002000;
  105.     codecCanMakeMask            = $00004000;
  106.     codecCanShift                = $00008000;
  107.     codecCanAsyncWhen            = $00010000;
  108.     codecCanShieldCursor        = $00020000;
  109.     codecCanManagePrevBuffer    = $00040000;
  110.     codecHasVolatileBuffer        = $00080000;
  111.     codecWantsRegionMask        = $00100000;
  112.  
  113.  
  114. TYPE
  115.     CodecCapabilitiesPtr = ^CodecCapabilities;
  116.     CodecCapabilities = RECORD
  117.         flags:                    LONGINT;
  118.         wantedPixelSize:        INTEGER;
  119.         extendWidth:            INTEGER;
  120.         extendHeight:            INTEGER;
  121.         bandMin:                INTEGER;
  122.         bandInc:                INTEGER;
  123.         pad:                    INTEGER;
  124.         time:                    LONGINT;
  125.     END;
  126.  
  127. {     codec condition flags     }
  128.  
  129. CONST
  130.     codecConditionFirstBand        = $00000001;
  131.     codecConditionLastBand        = $00000002;
  132.     codecConditionFirstFrame    = $00000004;
  133.     codecConditionNewDepth        = $00000008;
  134.     codecConditionNewTransform    = $00000010;
  135.     codecConditionNewSrcRect    = $00000020;
  136.     codecConditionNewMask        = $00000040;
  137.     codecConditionNewMatte        = $00000080;
  138.     codecConditionNewTransferMode = $00000100;
  139.     codecConditionNewClut        = $00000200;
  140.     codecConditionNewAccuracy    = $00000400;
  141.     codecConditionNewDestination = $00000800;
  142.     codecConditionFirstScreen    = $00001000;
  143.     codecConditionDoCursor        = $00002000;
  144.     codecConditionCatchUpDiff    = $00004000;
  145.     codecConditionMaskMayBeChanged = $00008000;
  146.     codecConditionCodecChangedMask = $80000000;
  147.  
  148.     codecInfoResourceType        = 'cdci';                        {  codec info resource type  }
  149.     codecInterfaceVersion        = 2;                            {  high word returned in component GetVersion  }
  150.  
  151.  
  152. TYPE
  153.     CDSequenceDataSourcePtr = ^CDSequenceDataSource;
  154.     CDSequenceDataSource = RECORD
  155.         recordSize:                LONGINT;
  156.         next:                    Ptr;
  157.         seqID:                    ImageSequence;
  158.         sourceID:                ImageSequenceDataSource;
  159.         sourceType:                OSType;
  160.         sourceInputNumber:        LONGINT;
  161.         dataPtr:                Ptr;
  162.         dataDescription:        Handle;
  163.         changeSeed:                LONGINT;
  164.         transferProc:            ProcPtr;
  165.         refCon:                    Ptr;
  166.     END;
  167.  
  168.     CodecCompressParamsPtr = ^CodecCompressParams;
  169.     CodecCompressParams = RECORD
  170.         sequenceID:                ImageSequence;                            {  precompress,bandcompress  }
  171.         imageDescription:        ImageDescriptionHandle;                    {  precompress,bandcompress  }
  172.         data:                    Ptr;
  173.         bufferSize:                LONGINT;
  174.         frameNumber:            LONGINT;
  175.         startLine:                LONGINT;
  176.         stopLine:                LONGINT;
  177.         conditionFlags:            LONGINT;
  178.         callerFlags:            CodecFlags;
  179.         capabilities:            CodecCapabilitiesPtr;                    {  precompress,bandcompress  }
  180.         progressProcRecord:        ICMProgressProcRecord;
  181.         completionProcRecord:    ICMCompletionProcRecord;
  182.         flushProcRecord:        ICMFlushProcRecord;
  183.         srcPixMap:                PixMap;                                    {  precompress,bandcompress  }
  184.         prevPixMap:                PixMap;
  185.         spatialQuality:            CodecQ;
  186.         temporalQuality:        CodecQ;
  187.         similarity:                Fixed;
  188.         dataRateParams:            DataRateParamsPtr;
  189.         reserved:                LONGINT;
  190.                                                                         {  The following fields only exist for QuickTime 2.1 and greater  }
  191.         majorSourceChangeSeed:    UInt16;
  192.         minorSourceChangeSeed:    UInt16;
  193.         sourceData:                CDSequenceDataSourcePtr;
  194.     END;
  195.  
  196.     CodecDecompressParamsPtr = ^CodecDecompressParams;
  197.     CodecDecompressParams = RECORD
  198.         sequenceID:                ImageSequence;                            {  predecompress,banddecompress  }
  199.         imageDescription:        ImageDescriptionHandle;                    {  predecompress,banddecompress  }
  200.         data:                    Ptr;
  201.         bufferSize:                LONGINT;
  202.         frameNumber:            LONGINT;
  203.         startLine:                LONGINT;
  204.         stopLine:                LONGINT;
  205.         conditionFlags:            LONGINT;
  206.         callerFlags:            CodecFlags;
  207.         capabilities:            CodecCapabilitiesPtr;                    {  predecompress,banddecompress  }
  208.         progressProcRecord:        ICMProgressProcRecord;
  209.         completionProcRecord:    ICMCompletionProcRecord;
  210.         dataProcRecord:            ICMDataProcRecord;
  211.         port:                    CGrafPtr;                                {  predecompress,banddecompress  }
  212.         dstPixMap:                PixMap;                                    {  predecompress,banddecompress  }
  213.         maskBits:                BitMapPtr;
  214.         mattePixMap:            PixMapPtr;
  215.         srcRect:                Rect;                                    {  predecompress,banddecompress  }
  216.         matrix:                    MatrixRecordPtr;                        {  predecompress,banddecompress  }
  217.         accuracy:                CodecQ;                                    {  predecompress,banddecompress  }
  218.         transferMode:            INTEGER;                                {  predecompress,banddecompress  }
  219.         frameTime:                ICMFrameTimePtr;                        {  banddecompress  }
  220.         reserved:                ARRAY [0..0] OF LONGINT;
  221.                                                                         {  The following fields only exist for QuickTime 2.0 and greater  }
  222.         matrixFlags:            SInt8;                                    {  high bit set if 2x resize  }
  223.         matrixType:                SInt8;
  224.         dstRect:                Rect;                                    {  only valid for simple transforms  }
  225.                                                                         {  The following fields only exist for QuickTime 2.1 and greater  }
  226.         majorSourceChangeSeed:    UInt16;
  227.         minorSourceChangeSeed:    UInt16;
  228.         sourceData:                CDSequenceDataSourcePtr;
  229.         maskRegion:                RgnHandle;
  230.     END;
  231.  
  232.  
  233. CONST
  234.     matrixFlagScale2x            = $00000080;
  235.     matrixFlagScale1x            = $00000040;
  236.     matrixFlagScaleHalf            = $00000020;
  237.  
  238. FUNCTION CDGetCodecInfo(storage: Handle; VAR info: CodecInfo): ComponentResult;
  239. FUNCTION CDGetCompressionTime(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LONGINT): ComponentResult;
  240. FUNCTION CDGetMaxCompressionSize(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; quality: CodecQ; VAR size: LONGINT): ComponentResult;
  241. FUNCTION CDPreCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  242. FUNCTION CDBandCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  243. FUNCTION CDPreDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  244. FUNCTION CDBandDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  245. FUNCTION CDCodecBusy(storage: Handle; seq: ImageSequence): ComponentResult;
  246. FUNCTION CDGetCompressedImageSize(storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; VAR dataSize: LONGINT): ComponentResult;
  247. FUNCTION CDGetSimilarity(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;
  248. FUNCTION CDTrimImage(storage: Handle; Desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; outData: Ptr; outBufferSize: LONGINT; flushProc: ICMFlushProcRecordPtr; VAR trimRect: Rect; progressProc: ICMProgressProcRecordPtr): ComponentResult;
  249. {$ENDC}
  250. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  251. FUNCTION CDRequestSettings(storage: Handle; settings: Handle; VAR rp: Rect; filterProc: ModalFilterUPP): ComponentResult;
  252. {$ENDC}
  253. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  254. FUNCTION CDGetSettings(storage: Handle; settings: Handle): ComponentResult;
  255. FUNCTION CDSetSettings(storage: Handle; settings: Handle): ComponentResult;
  256. FUNCTION CDCodecFlush(storage: Handle): ComponentResult;
  257. FUNCTION CDCodecSetTimeCode(storage: Handle; timeCodeFormat: UNIV Ptr; timeCodeTime: UNIV Ptr): ComponentResult;
  258. FUNCTION CDCodecIsImageDescriptionEquivalent(storage: Handle; newDesc: ImageDescriptionHandle; VAR equivalent: BOOLEAN): ComponentResult;
  259. FUNCTION CDCodecNewMemory(storage: Handle; VAR data: Ptr; dataSize: Size; dataUse: LONGINT; memoryGoneProc: ICMMemoryDisposedUPP; refCon: UNIV Ptr): ComponentResult;
  260. FUNCTION CDCodecDisposeMemory(storage: Handle; data: Ptr): ComponentResult;
  261. FUNCTION CDCodecHitTestData(storage: Handle; desc: ImageDescriptionHandle; data: UNIV Ptr; dataSize: Size; where: Point; VAR hit: BOOLEAN): ComponentResult;
  262. {$ENDC}
  263. {$ALIGN RESET}
  264. {$POP}
  265.  
  266. {$SETC UsingIncludes := ImageCodecIncludes}
  267.  
  268. {$ENDC} {__IMAGECODEC__}
  269.  
  270. {$IFC NOT UsingIncludes}
  271.  END.
  272. {$ENDC}
  273.